package com.zhentao.util;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @ClassName: PageInterceptor
 * @Author: muhaoyang1
 * @Date: 2024/12/17 18:15
 * @Comment:分页拦截器
 */
@Component
public class PageInterceptor {

    @Bean
    /**
     * @description:分页拦截器
     * @author: muhaoyang
     * @date: 2024/12/17 18:20
     * @param: []
     * @return: com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
     **/
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}
